package top.laoshuzi.designpatterns.base.behavior.mediator;

/**
 * 具体中介者
 */
public class ConcreteMediator extends Mediator {


    public ConcreteMediator(Colleage colleageA, Colleage colleageB, Colleage colleageC) {
        super(colleageA, colleageB, colleageC);
    }

    @Override
    public void affectA2B() {
        colleageB.setValue(colleageA.getValue() + 1);
    }

    @Override
    public void affectB2C() {
        colleageC.setValue(colleageB.getValue() + 1);
    }

    @Override
    public void affectC2B() {
        colleageB.setValue(colleageC.getValue() - 1);
    }

    @Override
    public void affectB2A() {
        colleageA.setValue(colleageB.getValue() - 1);
    }
}
